Index of /school/cs141/modified merge sort - linux/
Name | Last Modified | Size |
---|---|---|
Parent Directory | ||
as1 | 2011-07-11 07:00 | 44k |
as1.cc | 2011-07-11 07:00 | 3k |
as1.o | 2011-07-11 07:00 | 29k |
Dll.cc | 2011-07-11 07:00 | 1k |
Dll.cpp | 2011-07-11 07:00 | 1k |
Dll.h | 2011-07-11 07:00 | 1k |
Dll.o | 2011-07-11 07:00 | 18k |
Func.h | 2011-07-11 07:00 | 3k |
i | 2011-07-11 07:00 | 1k |
Node.cc | 2011-07-11 07:00 | 1k |
Node.cpp | 2011-07-11 07:00 | 1k |
Node.h | 2011-07-11 07:00 | 1k |
Node.o | 2011-07-11 07:00 | 3k |
o | 2011-07-11 07:00 | 1k |
--------------------------README----------------------------
This program impliments a modified merge sort algorithm. First the program
reads in a file full of "sets" organized in the following fashion:
k1
n1 n2 n3 n4 n5 n6
n7 n8 n9 n10 n11 n12
n13 ...
k2
m1 m2 m3 m4 m5 ...
where the k's are the "key" values, determining when to call the insertion
sort function from the merge sort function, and the n/m's are the values
to be sorted.
The program first will read in the k value, then proceed to read in the
values to be sorted for one set (while reading in the values are stored in
a linked list, so that the amount of values can be dynamic) Next the
modified merge sort algorithm is called, passing the array along with its
size. From there the merge sort function will break the array appart
(divide and conquer thereom) until the number of values to sort is less than
the k value for the set. At this point, it will call insertion sort on the
values. Finally, the values will be merged and the array saved.
Once all processes on the set have finished, the entire process will be
repeated until the end of the file is found.
To run the program from command prompt, type "as1 <inputfilename>
<outputfilename>" where <inputfilename> is the name of the file to read in
and <outputfilename> is the name of the file to store the sorted values in.
A sample test file has been provided (same as Jiang's) the name is "i" and the output file I use was "o"
Proudly Served by LiteSpeed Web Server at ryanhoskin.com Port 443